//
//  ZFToolSearchHeaderView.swift
//  map
//
//  Created by fyzq on 2024/1/25.
//

import UIKit
import JKSwiftExtension
class ZFMenuSearchHeaderView: UIView {
    override init(frame: CGRect) {
        super.init(frame: frame)
        setZFToolSearchHeaderView()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    fileprivate func setZFToolSearchHeaderView(){

        let searchIconLabel =  UILabel()
        searchIconLabel.font = UIFont.iconfont(size: 22)
        searchIconLabel.text = .icon(icon: .ic_search)
        addSubview(searchIconLabel)
        searchIconLabel.snp.makeConstraints { make in
            make.left.equalTo(10)
            make.centerY.equalToSuperview()
            make.width.height.equalTo(24)
        }
        
        
        let searchLabel = UILabel()
        searchLabel.textColor = R.color.color_99()
        searchLabel.text = "搜索问题"
        searchLabel.font = UIFont.systemFont(ofSize: 15)
        
        addSubview(searchLabel)
        searchLabel.snp.makeConstraints { make in
            make.left.equalTo(searchIconLabel.snp.right).offset(10)
            make.centerY.equalToSuperview()
        }
        
        
        let scanLabel =  UILabel()
        scanLabel.font = UIFont.iconfont(size: 22)
        scanLabel.text = .icon(icon: .ic_scan)
        scanLabel.textColor = R.color.color_21()
        scanLabel.textAlignment = .right
        addSubview(scanLabel)
        scanLabel.snp.makeConstraints { make in
            make.top.equalTo(8)
            make.width.height.equalTo(30)
            make.right.equalTo(-10)
            make.bottom.equalTo(-8)
        }
        
        
        backgroundColor = R.color.bg()
       
    }
    override func layoutSubviews() {
        super.layoutSubviews()
//        self.jk.addCornerAndShadow(superview: self.superview!, conrners: UIRectCorner.allCorners, shadowColor: .lightGray, shadowOffset: CGSize(width: 0, height: 1), shadowOpacity: 1,shadowRadius: 10)
        self.jk.addViewCornerAndShadow(conrners: UIRectCorner.allCorners,radius: 10, shadowColor: .lightGray, shadowOffset:  CGSize(width: 0, height: 1), shadowOpacity: 1,shadowRadius: 10)
    }

}
